package com.masterclient.app.businessmodule.minemodule.point.adapter;

import android.widget.LinearLayout;

import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.eoner.baselibrary.utils.ViewTransformUtil;
import com.masterclient.app.R;
import com.masterclient.app.businessmodule.minemodule.point.model.PointMainListChildBean;

/**
 * @auther hjian
 * @date 2020/7/2.
 */
public class PointEarnChildAdapter extends BaseQuickAdapter<PointMainListChildBean, BaseViewHolder> {

    int width;
    public PointEarnChildAdapter() {
        super(R.layout.item_gold_earn_child);
    }

    public void setWidth(int width){
        this.width = width;
    }

    @Override
    protected void convert(BaseViewHolder helper, PointMainListChildBean item) {

        LinearLayout ll = helper.getView(R.id.item_gold_earn_childroot);
        ll.getLayoutParams().width = width;
        ViewTransformUtil.glideImageView(mContext, item.getImage(), helper.getView(R.id.item_gold_earn_childimg), new CenterCrop(),
                R.mipmap.user_head_default_icon0);
        helper.setText(R.id.item_gold_earn_childname,item.getName());

    }

}
